<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="static/component/pear/css/pear.css" />
    <link rel="stylesheet" href="static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="static/css/public.css" media="all">
    <style type="text/css">
        .layui-table-cell {
            height: auto;
            line-height: 28px;
        }
    </style>
</head>
<body style="margin-left:50px">

<form class="layui-form" action="">
    <input style="width: 250px"  type="hidden" name="storgageRackId"   required  lay-verify="required"  autocomplete="off" class="layui-input" value="${storgageRack.storgageRackId}" />

    <div class="layui-form-item">
        <label class="layui-form-label">货架名称</label>
        <div class="layui-input-block">
            <input style="width: 250px"  type="text" name="storgageRackName"   required  lay-verify="required" placeholder="请输入货架名称" autocomplete="off" class="layui-input" value="${storgageRack.storgageRackName}" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总容量</label>
        <div class="layui-input-block">
            <input style="width: 250px"  type="text" name="goorssCapacity"   lay-verify="number"  placeholder="请输入总容量" autocomplete="off" class="layui-input" value="${storgageRack.goorssCapacity}" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">已用容量</label>
        <div class="layui-input-block">
            <input style="width: 250px"  type="text" name="residualCapacity"   lay-verify="number"  placeholder="请输入剩余容量" autocomplete="off" class="layui-input" value="${storgageRack.residualCapacity}" />
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit lay-filter="stogageRackAddForm">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="static/component/layui/layui.js"></script>
<script src="static/component/pear/pear.js"></script>

<script>

    layui.use(['laydate','form'], function() {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var form = layui.form;


        //表单提交事件
        form.on("submit(stogageRackAddForm)",function (data){
            //执行修改操作
            $.post("storgageRack/updateStogageRack",data.field,function (result){
                if (result.success){
                    layer.msg(result.msg,{icon:1,time:1000},function(){
                        window.close();
                        parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                        parent.parent.location.reload(); // 父页面刷新
                        parent.layui.table.reload("storgageRackTable");
                    });
                }
            })
        })
    })








</script>
</body>
</html>